﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="TorontoPicturesList.aspx.vb" Inherits="DusanProject.list" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:Table ID="tbl_Search" runat="server"  CssClass="tblSearch">
    <asp:TableRow>

        <asp:TableCell>
        
        Search :

        </asp:TableCell>

        <asp:TableCell>
        
        <asp:DropDownList ID="dd_Search" runat="server" Width="200px">
            <asp:ListItem Value="TorontoPictureName">Picture Name</asp:ListItem>
            <asp:ListItem Value="Description">Description</asp:ListItem>
            <asp:ListItem Value="YearTaken">Year</asp:ListItem>
        </asp:DropDownList> 
        
        </asp:TableCell>

         <asp:TableCell>
        
            <asp:TextBox ID="tb_Search" runat="server"></asp:TextBox>

        </asp:TableCell>

        <asp:TableCell HorizontalAlign="Center">
        
            <asp:Button ID="btn_Search" runat="server" Text="Search" CssClass="slideButton" />

        </asp:TableCell>

    </asp:TableRow>
    </asp:Table>
  
  <asp:Table ID="tableTag" CssClass="addTagTable" runat="server" CellPadding="5" CellSpacing="5" Width="600" >
  <asp:TableRow>
  <asp:TableCell>
 
         <asp:RadioButtonList ID="rbTagList" runat="server" 
        DataSourceID="SqlDataSource2" DataTextField="TagName" DataValueField="TagName" 
        RepeatDirection="Horizontal" AutoPostBack="false"> 
         </asp:RadioButtonList>

  </asp:TableCell>
  <asp:TableCell>
  <asp:Button ID="btn_SearchByTags" runat="server" Text="Search by Tags" CssClass="slideButton" />
  </asp:TableCell>
  </asp:TableRow>
  </asp:Table>

    <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
        ConnectionString="<%$ ConnectionStrings:dbDusanCS %>" 
        ProviderName="<%$ ConnectionStrings:dbDusanCS.ProviderName %>" 
        SelectCommand="SELECT [TagName] FROM [Tags] ORDER BY [TagName]">
    </asp:SqlDataSource>
     
   

    <p>
    </p>

    <asp:GridView ID="gw_list" runat="server" AllowSorting="True" 
            AutoGenerateColumns="False" DataKeyNames="ID" 
            DataSourceID="SqlDataSource1" Width="700px" CssClass="addTable" 
        CellPadding="4" ForeColor="#333333" GridLines="None">
        <AlternatingRowStyle BackColor="White" />
        <Columns>
            <asp:BoundField DataField="TorontoPictureName" HeaderText="Picture" 
                SortExpression="TorontoPictureName" />
            <asp:BoundField DataField="Description" HeaderText="Description" 
                SortExpression="Description" />
            <asp:BoundField DataField="YearTaken" HeaderText="Year" 
                SortExpression="YearTaken" />
            <asp:TemplateField HeaderText="Picture" SortExpression="Picture">
                <ItemTemplate>
                <a href="TorontoPictureDetail.aspx?ID=<%#Eval("ID") %>"><img alt="<%#Eval("TorontoPictureName")%>" src="<%#Eval("Picture")%>" style="width:100px;height:75px" /></a>
                </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Rating" SortExpression="Picture">
                <ItemTemplate>
                <h1><%# getRating(Eval("ID"))%></h1>
                </ItemTemplate>
                </asp:TemplateField>

            <asp:CheckBoxField DataField="Active" Text="Active" />


        </Columns>
        <EditRowStyle BackColor="#2461BF" />
        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#EFF3FB" />
        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
        <SortedAscendingCellStyle BackColor="#F5F7FB" />
        <SortedAscendingHeaderStyle BackColor="#6D95E1" />
        <SortedDescendingCellStyle BackColor="#E9EBEF" />
        <SortedDescendingHeaderStyle BackColor="#4870BE" />
    </asp:GridView>

        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:dbDusanCS %>" 
            ProviderName="<%$ ConnectionStrings:dbDusanCS.ProviderName %>" 
            SelectCommand="SELECT [ID], [TorontoPictureName], [Description], [YearTaken], [Picture], [Active] FROM [TorontoPictures]">
        </asp:SqlDataSource>


        <br />



</asp:Content>
